Skip to content

feat(wangamail-csharp, wangapayfast-csharp): add initial implementations for email and payment processing clients#40

Merged
mitch1009 merged 10 commits into
mainfrom
feat/develoop
Mar 26, 2026
Merged

feat(wangamail-csharp, wangapayfast-csharp): add initial implementations for email and payment processing clients#40
mitch1009 merged 10 commits into
mainfrom
feat/develoop

Conversation

@mitch1009

Copy link
Copy Markdown
Contributor
  • Introduced GraphMailClient and GraphMailClientBuilder for sending emails via Microsoft Graph API.
  • Added PayFastClient and PayFastClientBuilder for building PayFast checkout payloads and signatures.
  • Implemented models for email and payment requests, including validation and error handling.
  • Created unit tests for both clients to ensure functionality and error handling.
  • Added README files for both libraries to provide usage instructions and features.

…ons for email and payment processing clients

- Introduced `GraphMailClient` and `GraphMailClientBuilder` for sending emails via Microsoft Graph API.
- Added `PayFastClient` and `PayFastClientBuilder` for building PayFast checkout payloads and signatures.
- Implemented models for email and payment requests, including validation and error handling.
- Created unit tests for both clients to ensure functionality and error handling.
- Added README files for both libraries to provide usage instructions and features.
…TP helpers

- Added `ItnNotification` class for parsing and verifying ITN payloads.
- Introduced `PayFastHttpHelpers` for post-back validation and generating payment identifiers.
- Enhanced `PayFastClient` with methods for ITN signature generation and verification.
- Updated `PayFastModels` to include `ItnPaymentStatus` enum and `OnsiteProcessResponse` model.
- Expanded README with ITN and HTTP helper usage examples.
- Added unit tests for ITN signature verification and post-back validation.
…nverter

- Removed the JsonStringEnumMemberName attribute from BodyType enum.
- Implemented BodyTypeJsonConverter for custom serialization and deserialization of BodyType values.
- Updated MessageBody to use the new BodyTypeJsonConverter for ContentType property.
- Modified project file to exclude test files from compilation.
…Microsoft Graph API

- Introduced `GraphMailClient` for sending emails with app registration credentials.
- Added data models for email payloads, including `Message`, `MessageBody`, `Recipient`, and `SendMailRequest`.
- Implemented error handling with custom exceptions: `ConfigError` and `GraphAPIError`.
- Created a CLI entry point for manual checks and environment variable support.
- Added unit tests to validate email payload structure.
- Included package metadata and usage instructions in README.
- Introduced `System.Text.Json` namespace to `GraphModels.cs` for enhanced JSON handling capabilities.
@mitch1009 mitch1009 self-assigned this Mar 26, 2026
- Modified the test commands in both `wangamail-csharp.yml` and `wangapayfast-csharp.yml` workflows to replace `--no-build` with `--no-restore`, improving efficiency by avoiding unnecessary restore operations during testing.
- Added `Xunit` namespace to `GraphModelsTests.cs` for unit testing support.
- Updated project file to exclude test files from compilation, improving build efficiency.
…istency

- Changed the hash conversion method in `PayFastClient` to use `Convert.ToHexString(hash).ToLowerInvariant()` for consistent lowercase output in both signature generation methods.
- Added `Xunit` namespace to `PayFastClientTests.cs` to support unit testing functionality.
- Updated `BuildSignaturePayload` and `BuildItnSignaturePayload` methods in `PayFastClient` from internal to public access, allowing for broader usage in external contexts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment